﻿// Owner: zhoub-g
// Co-Owner:
#include "ActionBase.h"
#include "Vector3d.h"
#include "IUiView.h"
#include "CommandBase.h"

namespace Sample
{
    typedef enum MoveTypeEnumLookAround
    {
        eLookAroundFront = 1,
        eLookAroundBack,
        eLookAroundUp,
        eLookAroundDown,
        eLookAroundLeft,
        eLookAroundRight,
    }eMoveTypeLookAround;

	class ActionLookAround : public gcmp::ActionBase
	{
	public:
		ActionLookAround();
		~ActionLookAround();

	public:
        /// \brief 键盘按下事件处理
        /// \see IAction
        virtual bool OnKeyDown(gcmp::IUiView* pCurrentView, int nChar) override;
        static bool IsRotating() { return m_isRotating; };
    private:
        // 移动相机位置
        void MovePosition(eMoveTypeLookAround nType, int nStep);

        // 获得移动步长
        int GetStep();
        static bool m_isRotating;

        bool m_bShiftDown;
        int m_nLineEditStep;
        int m_nLineEditStepPlus;
	};

    class CmdLookAround : public gcmp::CommandBase
    {
    public:
        CmdLookAround();

        virtual ~CmdLookAround();

        virtual bool IsEnabled() const override;

        virtual bool IsVisible() const override;

        virtual gcmp::OwnerPtr<gcmp::IAction> ExecuteCommand(const gcmp::CommandParameters& cmdParams) override;
    };

    class CmdSwitchCamera : public gcmp::CommandBase
    {
    public:
        CmdSwitchCamera();

        virtual ~CmdSwitchCamera() {};

        virtual bool IsEnabled() const override;

        virtual bool IsVisible() const override;

        virtual gcmp::OwnerPtr<gcmp::IAction> ExecuteCommand(const gcmp::CommandParameters& cmdParams) override;

        virtual bool ShouldPopExistingActionsBeforeExecution() const override { return false; }

    };
}